import 'package:flutter/material.dart';
import 'package:wallpaper/components/placeholder/appbar_base.dart';
import 'package:wallpaper/components/list_title/my_list_title.dart';
import 'package:wallpaper/components/list_title/my_list_title_model.dart';
import 'package:wallpaper/generated/l10n.dart';
import 'package:wallpaper/pages/other/setting/cache_clean.dart';
import 'package:wallpaper/pages/other/setting/grade_pixiv.dart';
import 'package:wallpaper/pages/other/setting/about_page.dart';
import 'package:wallpaper/pages/other/setting/settings_options.dart';
import 'package:wallpaper/pages/other/setting/wallhaven_apikey.dart';
import 'package:wallpaper/pages/theme/localizations_page.dart';
import 'package:wallpaper/pages/theme/theme_page.dart';

class SettingPage extends StatelessWidget {
  const SettingPage({super.key});

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context).colorScheme;
    List<MyListTitleModel> list = [
      MyListTitleModel(
        title: S.of(context).theme,
        leading: Icon(Icons.color_lens),
        route: ThemePage(),
      ),
      MyListTitleModel(
          title: S.of(context).internationalization,
          leading: Icon(Icons.language),
          route: LocalizationsPage()),
      MyListTitleModel(
          title: 'wallhaven apikey',
          leading: Icon(Icons.font_download_outlined),
          route: WallhavenApikey()),
      MyListTitleModel(
        title: S.of(context).cache,
        leading: Icon(Icons.cached_sharp),
        route: CacheClean(),
      ),
      MyListTitleModel(
        title: S.of(context).grade,
        leading: Icon(Icons.signal_cellular_alt),
        route: GradePixiv(),
      ),
      MyListTitleModel(
        title: '参数设置',
        leading: Icon(Icons.settings),
        route: SettingsOptions(),
      ),
      MyListTitleModel(
        title: S.of(context).about,
        leading: Icon(Icons.info_sharp),
        route: AboutPage(),
      ),
    ];
    return Scaffold(
      appBar: AppbarBase(title: S.of(context).setting),
      body: Column(
        children: [
          Container(
            margin: EdgeInsets.all(5),
            decoration: BoxDecoration(
                color: theme.primaryContainer,
                borderRadius: BorderRadius.circular(10),
                boxShadow: [
                  BoxShadow(
                    color: theme.shadow,
                    offset: Offset(0.2, 0.2),
                    blurRadius: 1,
                  ),
                ]),
            child: MyListTitle(list: list),
          )
        ],
      ),
    );
  }
}
